<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('分配页面')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-customer-assign">
        <input name="id" class="form-control" type="hidden" th:value="${customer.id}">
        <input name="distracTime" class="form-control" placeholder="yyyy-MM-dd hh:mm:ss"  type="hidden" th:value="${#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd hh:mm:ss')}">
           <div class="form-group">
            <label class="col-sm-3 control-label">部门：</label>
            <div class="col-sm-8">
                <select name="" class="form-control m-b" readonly>
                    <option value="108"  readonly>市场部</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">职位：</label>
            <div class="col-sm-8">
                <select name="role" id="role" class="form-control m-b">
                    <option value="">请选择职位</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-8">
                <select name="sysServiceUserId"  id="user" class="form-control m-b">
                    <option value="">请选择</option>
                </select>
            </div>
        </div>

<!--                    <option th:each=" c : ${cityList}" th:value="${c.cityId}" th:text="${c.cityName}" th:selected="${customer.sysCityId} eq ${c.cityId}"></option>-->
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />

<script th:inline="javascript">
    var prefix = ctx + "market/customer"
    $("#form-customer-assign").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/assign", $('#form-customer-assign').serialize());
        }
    }
</script>
<script>
    $(function () {
        $.get("/system/role/plist",'',function (data) {
            var plist="<option value=\"\">请选择职位</option>";
            $(data).each(function (i,e) {
                plist+="<option value='"+e.roleId+"'>"+e.roleName+"</option>";
            });
            $("#role").html(plist);
        },'json');

        $("#role").change(function () {
            var pid=$(this).val();
            $.get("/system/user/clist?pid="+pid,'',function (data) {
                var clist=" <option value=\"\">请选择用户</option>";
                $(data).each(function (i,e) {
                    clist+="<option value='"+e.userId+"'>"+e.userName+"</option>";
                });
                $("#user").html(clist);
            },"json");
        });
    });
</script>
</body>
</html>